<%@ page session="false" language="java" contentType="text/html; charset=UTF-8" trimDirectiveWhitespaces="true" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include.inc.jsp"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管线业务</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

    <!-- bootstrap & fontawesome -->
    <link rel="stylesheet" href="${contextPath}/resources/assets/css/bootstrap.css" />
    <link rel="stylesheet" href="${contextPath}/resources/assets/css/font-awesome.css" />

    <!-- page specific plugin styles -->
    <link rel="stylesheet" href="${contextPath}/resources/assets/css/jquery-ui.css" />
    <link rel="stylesheet" href="${contextPath}/resources/assets/css/bootstrap-datepicker3.css" />
	<link rel="stylesheet" href="${contextPath}/resources/assets/css/ui.jqgrid.css" />
    <!-- text fonts -->
    <link rel="stylesheet" href="${contextPath}/resources/assets/css/ace-fonts.css" />

    <!-- ace styles -->
    <link rel="stylesheet" href="${contextPath}/resources/assets/css/ace.css" class="ace-main-stylesheet" id="main-ace-style" />

    <!--[if lte IE 9]>
			<link rel="stylesheet" href="${contextPath}/resources/assets/css/ace-part2.css" class="ace-main-stylesheet" />
		<![endif]-->

    <!--[if lte IE 9]>
		  <link rel="stylesheet" href="${contextPath}/resources/assets/css/ace-ie.css" />
		<![endif]-->
	
    
    <!-- ace settings handler -->
    <script src="${contextPath}/resources/assets/js/ace-extra.js"></script>

    <!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->

    <!--[if lte IE 8]>
		<script src="${contextPath}/resources/assets/js/html5shiv.js"></script>
		<script src="${contextPath}/resources/assets/js/respond.js"></script>
		<![endif]-->

    <style>
        .seari_logo {
            padding-left: 10px;
            color: #ffffff;
            font-size: 20px;
            text-shadow: none;
            font-weight: 600;
            line-height: 80px;
        }
        
        .seari_logo:hover,
        .seari_logo:focus {
            color: #ffffff;
            text-decoration: none;
        }
        
        .navbar {
            min-height: 80px;
            background: url('${contextPath}/resources/img/navbar-bg.png') repeat-x;
        }
        
        .navbar .navbar-nav > li {
            border: 0px solid rgba(0, 0, 0, 0);
        }
        
        .navbar .navbar-nav > li > a {
            padding-top: 18px;
        }
        
        @media only screen and (max-width: 991px) {
            .navbar-nav {
                float: left;
                margin: 0;
            }
            .navbar-nav > li {
                float: left;
            }
            .navbar-menu-min .navbar-nav > li > a > .menu-title {
                /*display: none;*/
            }
            .seari_logo,.seari_user {
                display: none;
            }
            .navbar-menu{
                background-color: #607990;
            }
        }
        
        .navbar-menu {
            padding-top: 20px;
            
        }
        
        .menu-title {
            font: 16px/1.5 'Microsoft YaHei', SimSun;
        }
        
        .page-content {
            font: 12px/20px "Microsoft YaHei";
        }
        
        .sidebar {
            font-family: "Microsoft YaHei";
        }
        
        .breadcrumb {
            font-family: "Microsoft YaHei";
        }
        /****box design style*****/
        
        .box {
            float: left;
            box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
            display: block;
            background-color: #fff;
        }
        
        .london {
            border-top: 7px solid #19beb6;
        }
        
        .paris {
            border-top: 7px solid #df9801;
        }
        
        .box-icon {
            width: 100%;
            position: relative;
        }
        
        .info-nav-container {
            width: 32%;
            margin-right: 3%;
        }
        
        .float-container {
            overflow: auto;
        }
        
        .info {
            width: 100%;
            padding: 15px 30px 20px;
            font-size: 16px;
        }
        
        .info-description-container {
            padding: 20px 30px;
            float: right;
            width: 65%;
        }
        
        .london-title {
            padding: 0 0 0 5px;
            border-left: 2px solid #19beb6;
            margin: 25px 0px;
        }
        
        .london-title h2 {
            color: #19beb6;
            font: 24px/1.5 'Microsoft YaHei';
            margin: 5px;
        }
        
        .paris-title {
            border-left: 2px solid #df9801;
        }
        
        .paris-title h2 {
            color: #df9801;
            font: 24px/1.5 'Microsoft YaHei';
        }
        
        #webglcanvas {
				position: absolute;
				top: 0;
				left: 0;
				height: 100%;
				width: 100%;
				z-index: 0;
			}
    </style>
</head>
<body class="no-skin">
	<jsp:include page="index.jsp" flush="true" />
	<!-- /section:basics/navbar.layout -->
   <div class="main-container" id="main-container">
         <div id="sidebar" class="sidebar                  responsive">
            <script type="text/javascript">
                try {
                    ace.settings.check('sidebar', 'fixed');
                } catch (e) {}
            </script>
            
            <ul class="nav nav-list">
               <li class="">
                    <a href="#" class="dropdown-toggle">
                        <i class="menu-icon fa fa-tag"></i>
                        <span class="menu-text"> 入廊申请 </span>

                        <b class="arrow fa fa-angle-down"></b>
                    </a>

                    <b class="arrow"></b>

                    <ul class="submenu">
                        <li class="">
                            <a href="sqbDownUp?compId=&compName=&phoneNo=">
                                <i class="menu-icon fa fa-caret-right"></i> 申请表格下载/上传
                            </a>

                            <b class="arrow"></b>
                        </li>

                        <li class="">
                            <a href="sqbRecord">
                                <i class="menu-icon fa fa-caret-right"></i> 申请记录
                            </a>

                            <b class="arrow"></b>
                        </li>
                    </ul>
                </li>
                
                <li class="">
                    <a href="#" class="dropdown-toggle">
                        <i class="menu-icon fa fa-tag"></i>
                        <span class="menu-text"> 手续办理 </span>

                        <b class="arrow fa fa-angle-down"></b>
                    </a>

                    <b class="arrow"></b>

                    <ul class="submenu">
                        <li class="">
                            <a href="ywcz?compId=&compName=">
                                <i class="menu-icon fa fa-caret-right"></i> 业务操作
                            </a>

                            <b class="arrow"></b>
                        </li>

                        <li class="">
                            <a href="ywda">
                                <i class="menu-icon fa fa-caret-right"></i> 业务档案
                            </a>

                            <b class="arrow"></b>
                        </li>
                    </ul>
                </li>
                
                 <li class="">
                    <a href="#" class="dropdown-toggle">
                        <i class="menu-icon fa fa-tag"></i>
                        <span class="menu-text"> 合同管理 </span>

                        <b class="arrow fa fa-angle-down"></b>
                    </a>

                    <b class="arrow"></b>

                    <ul class="submenu">
                        <li class="">
                            <a href="htmbDownUp">
                                <i class="menu-icon fa fa-caret-right"></i> 合同模板下载/上传
                            </a>

                            <b class="arrow"></b>
                        </li>

                        <li class="">
                            <a href="htda">
                                <i class="menu-icon fa fa-caret-right"></i> 合同档案
                            </a>

                            <b class="arrow"></b>
                        </li>
                    </ul>
                </li>
                
                <li class="">
                    <a href="#" class="dropdown-toggle">
                        <i class="menu-icon fa fa-tag"></i>
                        <span class="menu-text"> 施工管理 </span>

                        <b class="arrow fa fa-angle-down"></b>
                    </a>

                    <b class="arrow"></b>

                    <ul class="submenu">
                        <li class="">
                            <a href="xkgl">
                                <i class="menu-icon fa fa-caret-right"></i> 许可管理
                            </a>

                            <b class="arrow"></b>
                        </li>

                        <li class="">
                            <a href="bzjgl">
                                <i class="menu-icon fa fa-caret-right"></i> 保证金管理
                            </a>

                            <b class="arrow"></b>
                        </li>
                        
                        <li class="">
                            <a href="fwsq">
                                <i class="menu-icon fa fa-caret-right"></i> 服务申请
                            </a>

                            <b class="arrow"></b>
                        </li>
                        
                        <li class="">
                            <a href="sgrz">
                                <i class="menu-icon fa fa-caret-right"></i> 施工日志
                            </a>

                            <b class="arrow"></b>
                        </li>
                        

                    </ul>
                </li>
                
                <li class="">
                    <a href="#" class="dropdown-toggle">
                        <i class="menu-icon fa fa-tag"></i>
                        <span class="menu-text"> 费用清算 </span>

                        <b class="arrow fa fa-angle-down"></b>
                    </a>

                    <b class="arrow"></b>

                    <ul class="submenu">
                        <li class="">
                            <a href="feeSimulate">
                                <i class="menu-icon fa fa-caret-right"></i> 入廊费用计算器
                            </a>

                            <b class="arrow"></b>
                        </li>

                        <li class="">
                            <a href="jfRecord">
                                <i class="menu-icon fa fa-caret-right"></i> 缴费记录
                            </a>

                            <b class="arrow"></b>
                        </li>
                    </ul>
                </li>
                
                 <li class="">
                    <a href="visitApply" >
                        <i class="menu-icon fa fa-tag"></i>
                        <span class="menu-text"> 参观申请 </span>
                        
                    </a>

                    <b class="arrow"></b>
                    
                </li>
                
                <li class="active open">
                    <a href="#" class="dropdown-toggle">
                        <i class="menu-icon fa fa-tag"></i>
                        <span class="menu-text"> 后台管理 </span>

                        <b class="arrow fa fa-angle-down"></b>
                    </a>

                    <b class="arrow"></b>

                    <ul class="submenu">
                        <li class="">
                            <a href="rlsqEdit">
                                <i class="menu-icon fa fa-caret-right"></i> 入廊申请
                            </a>

                            <b class="arrow"></b>
                        </li>

                        <li class="">
                            <a href="ywdaEdit">
                                <i class="menu-icon fa fa-caret-right"></i> 业务档案
                            </a>

                            <b class="arrow"></b>
                        </li>
                        
                        <li class="">
                            <a href="htdaEdit">
                                <i class="menu-icon fa fa-caret-right"></i> 合同档案
                            </a>

                            <b class="arrow"></b>
                        </li>
                        
                         <li class="">
                            <a href="xkglEdit">
                                <i class="menu-icon fa fa-caret-right"></i> 许可管理
                            </a>

                            <b class="arrow"></b>
                        </li>
                        
                        <li class="">
                            <a href="bzjEdit">
                                <i class="menu-icon fa fa-caret-right"></i> 保证金管理
                            </a>

                            <b class="arrow"></b>
                        </li>
                        
                        <li class="active">
                            <a href="fwsqEdit">
                                <i class="menu-icon fa fa-caret-right"></i> 服务申请
                            </a>

                            <b class="arrow"></b>
                        </li>
                        
                        <li class="">
                            <a href="sgjlEdit">
                                <i class="menu-icon fa fa-caret-right"></i> 施工记录
                            </a>

                            <b class="arrow"></b>
                        </li>
                        
                        <li class="">
                            <a href="jfjlEdit">
                                <i class="menu-icon fa fa-caret-right"></i> 缴费记录
                            </a>

                            <b class="arrow"></b>
                        </li>
                        
                        <li class="">
                            <a href="gxdaEdit">
                                <i class="menu-icon fa fa-caret-right"></i> 管线档案
                            </a>

                            <b class="arrow"></b>
                        </li>
                    </ul>
                </li>
            </ul>
            <div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
                <i class="ace-icon fa fa-angle-double-left" data-icon1="ace-icon fa fa-angle-double-left" data-icon2="ace-icon fa fa-angle-double-right"></i>
            </div>

            <!-- /section:basics/sidebar.layout.minimize -->
            <script type="text/javascript">
                try {
                    ace.settings.check('sidebar', 'collapsed');
                } catch (e) {}
            </script>
        </div>
	       <div class="main-content">
	       <div class="breadcrumbs" id="breadcrumbs">
                <ul class="breadcrumb">
                    <li>
                        <i class="ace-icon fa fa-home home-icon"></i>
                        <a href="#">管线业务</a>
                    </li>
                    <li>
                        <a href="#">后台管理</a>
                    </li>
                    <li class="active">服务申请</li>
                </ul>
                <!-- /.breadcrumb -->
            </div>
            <!-- /section:面包屑导航路径 basics/content.breadcrumbs -->
            
            <!-- PAGE CONTENT BEGINS -->
            <div class="page-content">
              <div class="row">
                <div class="col-xs-12">
                	<table id="grid-table"></table>

					<div id="grid-pager"></div>

					<script type="text/javascript">
						var $path_base = "..";//in Ace demo this will be used for editurl parameter
				    </script>
				    </div>
			  </div>
            </div>
            <!-- /.page-content -->
        </div>
        <!-- /.main-content -->
    </div>
    <!-- /.main-container -->

    <!-- basic scripts -->

    <!--[if !IE]> -->
    <script type="text/javascript">
        window.jQuery || document.write("<script src='${contextPath}/resources/assets/js/jquery.js'>" + "<" + "/script>");
    </script>
    
    <script src="${contextPath}/resources/js/ajaxfileupload.js"></script>
    
    <script type="text/javascript">
       var contextPath = '${contextPath}';
    </script>
    <!-- <![endif]-->

    <!--[if IE]>
<script type="text/javascript">
 window.jQuery || document.write("<script src='${contextPath}/resources/assets/js/jquery1x.js'>"+"<"+"/script>");
</script>
<![endif]-->
    <script type="text/javascript">
        if ('ontouchstart' in document.documentElement) document.write("<script src='${contextPath}/resources/assets/js/jquery.mobile.custom.js'>" + "<" + "/script>");
    </script>
    <script src="${contextPath}/resources/assets/js/bootstrap.js"></script>
    
    <script src="${contextPath}/resources/assets/js/date-time/bootstrap-datepicker.js"></script>
	<script src="${contextPath}/resources/assets/js/jqGrid/jquery.jqGrid.js"></script>
	<script src="${contextPath}/resources/assets/js/jqGrid/i18n/grid.locale-cn.js"></script>

    <!-- page specific plugin scripts -->
        <script src="${contextPath}/resources/assets/js/ace/elements.scroller.js"></script>
		<script src="${contextPath}/resources/assets/js/ace/elements.colorpicker.js"></script>
		<script src="${contextPath}/resources/assets/js/ace/elements.fileinput.js"></script>
		<script src="${contextPath}/resources/assets/js/ace/elements.typeahead.js"></script>
		<script src="${contextPath}/resources/assets/js/ace/elements.wysiwyg.js"></script>
		<script src="${contextPath}/resources/assets/js/ace/elements.spinner.js"></script>
		<script src="${contextPath}/resources/assets/js/ace/elements.treeview.js"></script>
		<script src="${contextPath}/resources/assets/js/ace/elements.wizard.js"></script>
		<script src="${contextPath}/resources/assets/js/ace/elements.aside.js"></script>
		<script src="${contextPath}/resources/assets/js/ace/ace.js"></script>
		<script src="${contextPath}/resources/assets/js/ace/ace.ajax-content.js"></script>
		<script src="${contextPath}/resources/assets/js/ace/ace.touch-drag.js"></script>
		<script src="${contextPath}/resources/assets/js/ace/ace.sidebar.js"></script>
		<script src="${contextPath}/resources/assets/js/ace/ace.sidebar-scroll-1.js"></script>
		<script src="${contextPath}/resources/assets/js/ace/ace.submenu-hover.js"></script>
		<script src="${contextPath}/resources/assets/js/ace/ace.widget-box.js"></script>
		<script src="${contextPath}/resources/assets/js/ace/ace.settings.js"></script>
		<script src="${contextPath}/resources/assets/js/ace/ace.settings-rtl.js"></script>
		<script src="${contextPath}/resources/assets/js/ace/ace.settings-skin.js"></script>
		<script src="${contextPath}/resources/assets/js/ace/ace.widget-on-reload.js"></script>
		<script src="${contextPath}/resources/assets/js/ace/ace.searchbox-autocomplete.js"></script>
    <!-- inline scripts related to this page -->
    <script type="text/javascript">
			
    jQuery(function($) {
    	var grid_selector = "#grid-table";
		var pager_selector = "#grid-pager";
		
		var parent_column = $(grid_selector).closest('[class*="col-"]');
		//resize to fit page size
		$(window).on('resize.jqGrid', function () {
			$(grid_selector).jqGrid( 'setGridWidth', parent_column.width() );
	    })
		
		//resize on sidebar collapse/expand
		$(document).on('settings.ace.jqGrid' , function(ev, event_name, collapsed) {
			if( event_name === 'sidebar_collapsed' || event_name === 'main_container_fixed' ) {
				//setTimeout is for webkit only to give time for DOM changes and then redraw!!!
				setTimeout(function() {
					$(grid_selector).jqGrid( 'setGridWidth', parent_column.width() );
				}, 0);
			}
	    })
	    
	    jQuery(grid_selector).jqGrid({
	    	url:"loadServiceParam",
			datatype: "json",
			height: 358,
			colNames:['id','施工单位','服务类型', '申请表', '申请时间', '档案上传人'],
			colModel:[
						{name:'id',index:'id',editable:true,hidden:true},
						{name:'name',index:'name',width:260,editable: true},
						{name:'type',index:'type',width:240,editable: true},
						{name:'sFile',index:'sFile',width:130,search:false,formatter: cLink,editable: true,edittype:'file',editoptions:{enctype:"multipart/form-data"},search: false},
						{name:'createTime',index:'createTime',width:200,editable: false},
						{name:'operator',index:'operator',width:130,editable: false}
						
					], 
			
					viewrecords : true,
					rowNum:10,
					rowList:[10,20,30],
					pager : pager_selector,
					altRows: true,
					//toppager: true,
					
					multiselect: true,
					//multikey: "ctrlKey",
			        multiboxonly: true,
			
					loadComplete : function() {
						var table = this;
						setTimeout(function(){
							styleCheckbox(table);
							
							updateActionIcons(table);
							updatePagerIcons(table);
							enableTooltips(table);
						}, 0);
					},
			
					editurl: "deleteServiceApplication",//nothing is savedw
					caption: "服务申请表"
			
					//,autowidth: true,
			
			
					/**
					,
					grouping:true, 
					groupingView : { 
						 groupField : ['name'],
						 groupDataSorted : true,
						 plusicon : 'fa fa-chevron-down bigger-110',
						 minusicon : 'fa fa-chevron-up bigger-110'
					},
					caption: "Grouping"
					*/
			
				});
				$(window).triggerHandler('resize.jqGrid');//trigger window resize to make the grid get the correct size
				
				function aceSwitch( cellvalue, options, cell ) {
					setTimeout(function(){
						$(cell) .find('input[type=checkbox]')
							.addClass('ace ace-switch ace-switch-5')
							.after('<span class="lbl"></span>');
					}, 0);
				}
				//enable datepicker
				function pickDate( cellvalue, options, cell ) {
					setTimeout(function(){
						$(cell) .find('input[type=text]')
								.datepicker({format:'yyyy-mm-dd HH:MM:ss' , autoclose:true}); 
					}, 0);
				}
				
				jQuery(grid_selector).jqGrid('navGrid',pager_selector,
						{ 	//navbar options
							edit: false,
							editicon : 'ace-icon fa fa-pencil blue',
							add: false,
							addicon : 'ace-icon fa fa-plus-circle purple',
							del: true,
							delicon : 'ace-icon fa fa-trash-o red',
							search: true,
							searchicon : 'ace-icon fa fa-search orange',
							refresh: true,
							refreshicon : 'ace-icon fa fa-refresh green',
							view: true,
							viewicon : 'ace-icon fa fa-search-plus grey',
						},
						{
							//delete record form
							recreateForm: true,
							beforeShowForm : function(e) {
								var form = $(e[0]);
								if(form.data('styled')) return false;
								
								form.closest('.ui-jqdialog').find('.ui-jqdialog-titlebar').wrapInner('<div class="widget-header" />')
								style_delete_form(form);
								
								form.data('styled', true);
							},
							onClick : function(e) {
								//alert(1);
							}
						},
						{
							//search form
							recreateForm: true,
							afterShowSearch: function(e){
								var form = $(e[0]);
								form.closest('.ui-jqdialog').find('.ui-jqdialog-title').wrap('<div class="widget-header" />')
								style_search_form(form);
							},
							afterRedraw: function(){
								style_search_filters($(this));
							}
							,
							multipleSearch: true,
							/**
							multipleGroup:true,
							showQuery: true
							*/
						},
						{
							//view record form
							recreateForm: true,
							beforeShowForm: function(e){
								var form = $(e[0]);
								form.closest('.ui-jqdialog').find('.ui-jqdialog-title').wrap('<div class="widget-header" />')
							}
						}
					)
				
				
					
					function style_edit_form(form) {
								   //don't wrap inside a label element, the checkbox value won't be submitted (POST'ed)
								  //.addClass('ace ace-switch ace-switch-5').wrap('<label class="inline" />').after('<span class="lbl"></span>');
				
								
						//update buttons classes
						var buttons = form.next().find('.EditButton .fm-button');
						buttons.addClass('btn btn-sm').find('[class*="-icon"]').hide();//ui-icon, s-icon
						buttons.eq(0).addClass('btn-primary').prepend('<i class="ace-icon fa fa-check"></i>');
						buttons.eq(1).prepend('<i class="ace-icon fa fa-times"></i>')
						
						buttons = form.next().find('.navButton a');
						buttons.find('.ui-icon').hide();
						buttons.eq(0).append('<i class="ace-icon fa fa-chevron-left"></i>');
						buttons.eq(1).append('<i class="ace-icon fa fa-chevron-right"></i>');		
					}
				
					function style_delete_form(form) {
						var buttons = form.next().find('.EditButton .fm-button');
						buttons.addClass('btn btn-sm btn-white btn-round').find('[class*="-icon"]').hide();//ui-icon, s-icon
						buttons.eq(0).addClass('btn-danger').prepend('<i class="ace-icon fa fa-trash-o"></i>');
						buttons.eq(1).addClass('btn-default').prepend('<i class="ace-icon fa fa-times"></i>')
					}
					
					function style_search_filters(form) {
						form.find('.delete-rule').val('X');
						form.find('.add-rule').addClass('btn btn-xs btn-primary');
						form.find('.add-group').addClass('btn btn-xs btn-success');
						form.find('.delete-group').addClass('btn btn-xs btn-danger');
					}
					function style_search_form(form) {
						var dialog = form.closest('.ui-jqdialog');
						var buttons = dialog.find('.EditTable')
						buttons.find('.EditButton a[id*="_reset"]').addClass('btn btn-sm btn-info').find('.ui-icon').attr('class', 'ace-icon fa fa-retweet');
						buttons.find('.EditButton a[id*="_query"]').addClass('btn btn-sm btn-inverse').find('.ui-icon').attr('class', 'ace-icon fa fa-comment-o');
						buttons.find('.EditButton a[id*="_search"]').addClass('btn btn-sm btn-purple').find('.ui-icon').attr('class', 'ace-icon fa fa-search');
					}
					
					function beforeDeleteCallback(e) {
						var form = $(e[0]);
						if(form.data('styled')) return false;
						
						form.closest('.ui-jqdialog').find('.ui-jqdialog-titlebar').wrapInner('<div class="widget-header" />')
						style_delete_form(form);
						
						form.data('styled', true);
					}
					
					function beforeEditCallback(e) {
						var form = $(e[0]);
						form.closest('.ui-jqdialog').find('.ui-jqdialog-titlebar').wrapInner('<div class="widget-header" />')
						style_edit_form(form);
					}
				
				
				
					//it causes some flicker when reloading or navigating grid
					//it may be possible to have some custom formatter to do this as the grid is being created to prevent this
					//or go back to default browser checkbox styles for the grid
					function styleCheckbox(table) {
					/**
						$(table).find('input:checkbox').addClass('ace')
						.wrap('<label />')
						.after('<span class="lbl align-top" />')
				
				
						$('.ui-jqgrid-labels th[id*="_cb"]:first-child')
						.find('input.cbox[type=checkbox]').addClass('ace')
						.wrap('<label />').after('<span class="lbl align-top" />');
					*/
					}
					
				
					//unlike navButtons icons, action icons in rows seem to be hard-coded
					//you can change them like this in here if you want
					function updateActionIcons(table) {
						/**
						var replacement = 
						{
							'ui-ace-icon fa fa-pencil' : 'ace-icon fa fa-pencil blue',
							'ui-ace-icon fa fa-trash-o' : 'ace-icon fa fa-trash-o red',
							'ui-icon-disk' : 'ace-icon fa fa-check green',
							'ui-icon-cancel' : 'ace-icon fa fa-times red'
						};
						$(table).find('.ui-pg-div span.ui-icon').each(function(){
							var icon = $(this);
							var $class = $.trim(icon.attr('class').replace('ui-icon', ''));
							if($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);
						})
						*/
					}
					
					//replace icons with FontAwesome icons like above
					function updatePagerIcons(table) {
						var replacement = 
						{
							'ui-icon-seek-first' : 'ace-icon fa fa-angle-double-left bigger-140',
							'ui-icon-seek-prev' : 'ace-icon fa fa-angle-left bigger-140',
							'ui-icon-seek-next' : 'ace-icon fa fa-angle-right bigger-140',
							'ui-icon-seek-end' : 'ace-icon fa fa-angle-double-right bigger-140'
						};
						$('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function(){
							var icon = $(this);
							var $class = $.trim(icon.attr('class').replace('ui-icon', ''));
							
							if($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);
						})
					}
				
					function enableTooltips(table) {
						$('.navtable .ui-pg-button').tooltip({container:'body'});
						$(table).find('.ui-pg-div').tooltip({container:'body'});
					}
					
					function cLink(cellvalue, options, rowObject){
						var type = rowObject.type;
						if(cellvalue!==null&&cellvalue!==""){
						return "<a href='javascript:;' onclick='sFileGridDownload(\""+cellvalue+"\",\""+type+"\")'>下载</a>";
						}else{
							return '';
						}
						}
					
					//var selr = jQuery(grid_selector).jqGrid('getGridParam','selrow');
				
					$(document).one('ajaxloadstart.page', function(e) {
						$.jgrid.gridDestroy(grid_selector);
						$('.ui-jqdialog').remove();
					});
    });
    function sFileGridDownload(path,type){
        window.open('sFileGridDownload?file='+encodeURIComponent(path)+'&type='+encodeURIComponent(type));
      }
    </script>
</body>
</html>
